package com.ews.onlineexchange.util;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ApplicationScoped;
import javax.faces.context.FacesContext;
import javax.inject.Named;

@Named
@ApplicationScoped
public class ErrorMessageUtil {
	
	public static Object returnErrorMsg(String clientId, String msg) {
		FacesContext fc = FacesContext.getCurrentInstance();
		FacesMessage message = new FacesMessage(msg);
		message.setSeverity(FacesMessage.SEVERITY_ERROR);
		fc.addMessage(clientId, message);  
        fc.renderResponse();  
		return null;
	}
	
}
